package net.doyouhike.app.bbs.biz.db.green.help;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import net.doyouhike.app.bbs.biz.db.green.entities.ChatDraft;
import net.doyouhike.app.bbs.biz.db.green.entities.ChatUserInfo;
import net.doyouhike.app.bbs.biz.db.green.entities.Follow;
import net.doyouhike.app.bbs.biz.db.green.entities.UserFans;

import net.doyouhike.app.bbs.biz.db.green.help.ChatDraftDao;
import net.doyouhike.app.bbs.biz.db.green.help.ChatUserInfoDao;
import net.doyouhike.app.bbs.biz.db.green.help.FollowDao;
import net.doyouhike.app.bbs.biz.db.green.help.UserFansDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig chatDraftDaoConfig;
    private final DaoConfig chatUserInfoDaoConfig;
    private final DaoConfig followDaoConfig;
    private final DaoConfig userFansDaoConfig;

    private final ChatDraftDao chatDraftDao;
    private final ChatUserInfoDao chatUserInfoDao;
    private final FollowDao followDao;
    private final UserFansDao userFansDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        chatDraftDaoConfig = daoConfigMap.get(ChatDraftDao.class).clone();
        chatDraftDaoConfig.initIdentityScope(type);

        chatUserInfoDaoConfig = daoConfigMap.get(ChatUserInfoDao.class).clone();
        chatUserInfoDaoConfig.initIdentityScope(type);

        followDaoConfig = daoConfigMap.get(FollowDao.class).clone();
        followDaoConfig.initIdentityScope(type);

        userFansDaoConfig = daoConfigMap.get(UserFansDao.class).clone();
        userFansDaoConfig.initIdentityScope(type);

        chatDraftDao = new ChatDraftDao(chatDraftDaoConfig, this);
        chatUserInfoDao = new ChatUserInfoDao(chatUserInfoDaoConfig, this);
        followDao = new FollowDao(followDaoConfig, this);
        userFansDao = new UserFansDao(userFansDaoConfig, this);

        registerDao(ChatDraft.class, chatDraftDao);
        registerDao(ChatUserInfo.class, chatUserInfoDao);
        registerDao(Follow.class, followDao);
        registerDao(UserFans.class, userFansDao);
    }
    
    public void clear() {
        chatDraftDaoConfig.clearIdentityScope();
        chatUserInfoDaoConfig.clearIdentityScope();
        followDaoConfig.clearIdentityScope();
        userFansDaoConfig.clearIdentityScope();
    }

    public ChatDraftDao getChatDraftDao() {
        return chatDraftDao;
    }

    public ChatUserInfoDao getChatUserInfoDao() {
        return chatUserInfoDao;
    }

    public FollowDao getFollowDao() {
        return followDao;
    }

    public UserFansDao getUserFansDao() {
        return userFansDao;
    }

}
